//
//  FishManager.h
//  fish
//
//  Created by 袁飞 on 12-8-28.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FObject.h"

@interface FishConfig : NSObject{
  int         level_;
  CGPoint     depth_;
  int         speed_;
  int         money_;
  int         gem_;
  int         gem_gailv_;
  int         vision_;
  NSString*   name_;
  NSString*   img_;
};
@property (nonatomic, readwrite) int level;
@property (nonatomic, readwrite) NSString* name;
@property (nonatomic, readwrite) NSString* img;
@property (nonatomic, readwrite) CGPoint depth;
@property (nonatomic, readwrite) int speed;
@property (nonatomic, readwrite) int vision;
@property (nonatomic, readwrite) int money;
@property (nonatomic, readwrite) int gem;
@property (nonatomic, readwrite) int gem_gailv;

+(FishConfig*)fishConfigWithDict:(NSMutableDictionary*)dict;
-(id)initWithDict:(NSMutableDictionary*)dict;
@end

@interface FishData : FObject{
  //NSString*   id_;
  //int         depth_;
  //int         speed_;
  //int         vision_;
  //FObject*    view_;
  FishConfig  *config_;
};
@property (nonatomic, readwrite) FishConfig* config;
//@property (nonatomic, readwrite) int depth;
//@property (nonatomic, readwrite) int speed;
//@property (nonatomic, readwrite) int vision;

+(FishData*)FishDataWithConfig:(FishConfig*)cfg;
-(id)initWithConfig:(FishConfig*)cfg;
-(CGPoint)getWorldPosition;
-(CGPoint)getLocalPosition;
@end

@interface FishManager : NSObject{
  NSMutableArray *fishes_;
  NSMutableDictionary *fish_config_;  
}
@property (nonatomic, readwrite) NSMutableArray* fishes;

+ (FishManager *)sharedFishManager;
-(id)init;
-(void)load;
-(FishConfig*)getFishConfig:(NSString*)name;
-(NSMutableArray*)getFishConfigWithDepth:(int)depth;
-(void)genFishes;
@end
